<extend name="Public:base" />

<block name="content">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><em class="glyphicon glyphicon-cloud-upload"></em> 
            {$type}         
            </h3>
            

            <nav class="navbar navbar-default">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <span class="navbar-text">模板选择：</span>
                        <foreach name='vlistFileType' item='v'>
                        <a href="{:U('index', array('ftype' => $key))}" class="btn btn-sm navbar-btn <eq name='key' value='$ftype'>btn-info<else/>btn-default</eq>">{$v}</a>
                        </foreach>
                    </div>
                </div>
            </nav>
        </div>
        
    </div>

    <div class="row margin-botton">
        <div class="col-sm-6 column">
            <div class="btn-group btn-group-md">                
                <button class="btn btn-primary" type="button" onclick="goUrl('{:U('add', array('ftype'=>$ftype, 'flag' => 1))}')"><em class="glyphicon glyphicon-plus-sign"></em> 新建模板[列表/单页]</button>
                <button class="btn btn-default" type="button" onclick="goUrl('{:U('add', array('ftype'=>$ftype, 'flag' => 2))}')"><em class="glyphicon glyphicon-plus-sign"></em> 新建模板[内容页]</button>
                <button class="btn btn-default" type="button" onclick="goUrl('{:U('add', array('ftype'=>$ftype, 'flag' => 0))}')"><em class="glyphicon glyphicon-plus-sign"></em> 新建模板[首页]</button>
            </div>
        </div>
        <div class="col-sm-6 text-right">
        <span class="label label-default">{$vlist|count}个模板</span>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <form action="" method="post" id="form_do" name="form_do">
                <div class="table-responsive">
                    <table class="table table-hover xyh-table-bordered-out">
                        <thead>
                            <tr class="active">
                                <th>名称</th>
                                <th>可写</th>
                                <th>发布时间</th>
                                <th class="text-right">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <foreach name='vlist' item='v'>
                        <tr>
                            <td>{$v.name}</td>
                            <td><notempty name="v['write']">是<else/>否</notempty></td>
                            <td>{$v.mtime|date='Y-m-d H:i:s', ###}</td>
                            <td class="text-right">
                            <a href="{:U('edit',array('ftype' => $ftype,'fname' => $v['bname']), '')}" class="label label-success">编辑</a>                            
                            </td>
                        </tr>
                        </foreach>
                        </tbody>
                    </table>
                </div>
            </form>

            
        </div>
    </div>
    </block>